package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLString;
import HLLib.base.HLUtil;

public class HLClassUtil extends HLLibClass {
    public HLClassUtil(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLUtil();
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            HLUtil.Println((HLString)args.GetObject(0));
            break;
        }
        case 1: {
            HLUtil.PrintIntln(args.GetInt(0));
            break;
        }
        case 2: {
            HLUtil.PrintBoolln(args.GetBoolean(0));
            break;
        }
        case 3: {
            HLUtil.OpenUrl((HLString)args.GetObject(0));
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                HLUtil.SendMessage((HLString)args.GetObject(0), (HLString)args.GetObject(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLUtil.SendMessage((HLString)args.GetObject(0), (HLString)args.GetObject(1)));
            }
            break;
        }
        }
    }
}
